import 'package:flutter/material.dart';
import 'package:syn_4s/ui/pages/surveillance/surveillance.dart';

import '../../ui/pages/google_map/google_map.dart';
import '../../ui/pages/login/forgot_pw.dart';
import '../../ui/pages/login/login.dart';
import '../../ui/pages/login/reset_pw.dart';
import '../../ui/pages/main/main.dart';
import '../../ui/pages/setting/about_us.dart';
import '../../ui/pages/setting/change_pwd.dart';
import '../../ui/pages/setting/language.dart';
import '../../ui/pages/setting/setting.dart';
import '../../ui/pages/setting/verification_pwd.dart';

class MyRouter {
  static final String mainRoute = MainScreen.routeName;
  static final String loginRoute = LoginScreen.routeName;
  static final String forgotPwRoute = ForgotPwScreen.routeName;
  static final String resetPwRoute = ResetPwScreen.routeName;
  static final String googleMapRoute = GoogleMapScreen.routeName;
  static final String surveillanceRoute = SurveillanceScreen.routeName;
  static final String settingRoute = SettingScreen.routeName;
  static final String languageRoute = LanguageScreen.routeName;
  static final String verificationPwdRoute = VerificationPwdScreen.routeName;
  static final String changePwdRoute = ChangePwdScreen.routeName;
  static final String aboutUsRoute = AboutUsScreen.routeName;

  static final Map<String, WidgetBuilder> routes = {
    MainScreen.routeName: (ctx) => MainScreen(),
    LoginScreen.routeName: (ctx) => LoginScreen(),
    ForgotPwScreen.routeName: (ctx) => ForgotPwScreen(),
    ResetPwScreen.routeName: (ctx) => ResetPwScreen(),
    GoogleMapScreen.routeName: (ctx) => GoogleMapScreen(),
    SurveillanceScreen.routeName: (ctx) => SurveillanceScreen(),
    SettingScreen.routeName: (ctx) => SettingScreen(),
    LanguageScreen.routeName: (ctx) => LanguageScreen(),
    ChangePwdScreen.routeName: (ctx) => ChangePwdScreen(),
    VerificationPwdScreen.routeName: (ctx) => VerificationPwdScreen(),
    AboutUsScreen.routeName: (ctx) => AboutUsScreen()
  };

  static final RouteFactory generateRoute = (settings) {
    return null;
  };

  static final RouteFactory unknownRoute = (settings) {
    return null;
  };

  static String getCurrentRoute(BuildContext context){
    return ModalRoute.of(context)?.settings.name ??"";
  }
}
